fix(provider): keep bounded provider error summaries in telemetry - #1699
Merged
Conversation
JUNIOR-8T collapsed stream failures to AI provider error: network with no safe cause text, so gateway HTTP 200 + stopReason error spikes were hard to attribute. Attach a redacted summary on terminal, retry, and chat-span telemetry without raw provider payloads. Co-Authored-By: David Cramer <david@sentry.io> Co-Authored-By: David Cramer <david@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Use low-cardinality error.type from ProviderError.kind, keep a bounded status description, and drop the oxlint character-class escape warning. Co-Authored-By: David Cramer <david@sentry.io>
dcramer
marked this pull request as ready for review
August 26, 2026 02:43
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2c1b311. Configure here.
Drop the retry-attributes wrapper and public summarizer export. Keep one bounded summary path through getProviderErrorAttributes, reuse the already classified ProviderError on retries, and avoid double createProviderError on chat spans. Co-Authored-By: David Cramer <david@sentry.io>
dcramer
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

JUNIOR-8T showed
ProviderError: AI provider error: networkafter AI Gateway returned HTTP 200 and the model stream failed. Junior already classified and retried correctly, but terminal Sentry events and retry logs dropped the provider cause text. That left the spike looking like a generic network outage with no way to tell stream-incomplete wording from a true transport failure.#1697 improved transcript failure codes and
app.ai.failure_reason. That names the lifecycle class. It still does not keep a safe provider cause string on the provider-error path.This keeps a short, redacted provider summary on the paths that matter:
app.ai.provider_error.summaryon terminal provider-error capturesagent.turn.provider.retrying, plusapp.ai.provider_error.retry_attemptgen_ai.chatspan attributes/status whenstopReason=errorGateway JSON bodies are stripped so telemetry stays free of raw provider payloads. User-facing copy is unchanged.
This does not stop upstream stream failures. It makes the next JUNIOR-8T-style spike attributable, including the one-conversation prompt/history hypothesis.
Evidence: https://sentry.sentry.io/issues/7692564933/
Requested by David Cramer.
--
View Junior Session [Sentry]